//不分页 数据格式
const res = {
	data:{
		status:"200",
		data:[],
	}
};
//分页数据格式
// res.data.data = {
// 	maxResults:40,
// 	resultCount:100,
// 	currentPage:1,
// 	results:[]
// };
function request(api, method, params, header, options = {}){
	console.log(api, method, params, header, options);
	return new Promise((resolve)=>{
		resolve(res)
	})
}

function reqGet(api, params = {}, options = {}){
	return request(api, 'GET', params, {
		Accept: 'application/json;charset=UTF-8'
	}, options);
}
function jsonPost(api, params = {}, options = {}){
	return request(api, 'POST', data, {
		Accept: 'application/json;charset=UTF-8',
		'Content-Type': 'application/json;charset=UTF-8'
	}, options);
}
function formPost(api, params = {}, options = {}){
	return request(api, 'POST', data, {
		'Content-Type': 'application/x-www-form-urlencoded'
	}, options);
}

export default {
	request,
	reqGet,
	jsonPost,
	formPost,
}

